<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <div class="tile">
        <h2 class="tile-title m-b-5" id="city">天气预报</h2>
        <div class="tile-config dropdown">
            <a  href="javascript:loadTQ();" class="tooltips tile-menu" title="" data-original-title="刷新"></a>
        </div>
        
        <div class="p-10 news">
            <div class="col-xs-4">
                <div class="tile p-5 m-b-10">
                    <a target="_blank" title="今天天气" href="javascript:void(0)">
                        <img class="w-100 tqtp" src="/DJSBlog/back/img/projects/1.png" alt="">
                        <p class="m-t-10 tq">
                        	Medical-Pro Bootstrap Responsive	
                        	Medical-Pro Bootstrap Responsive
                        </p>
                    </a>
                    <div class="clearfix"></div>
                </div>
            </div>
            <div class="col-xs-4">
                <div class="tile p-5 m-b-10">
                    <a target="_blank" title="明天天气" href="javascript:void(0)">
                        <img class="w-1000 tqtp" src="/DJSBlog/back/img/projects/2.png" alt="">
						 <p class="m-t-10 tq">
                        	Medical-Pro Bootstrap Responsive
                        	Medical-Pro Bootstrap Responsive
                        	Medical-Pro Bootstrap Responsive
                        </p>                       
                    </a>
                    <div class="clearfix"></div>
                </div>
            </div>
            <div class="col-xs-4">
                <div class="tile p-5 m-b-10">
                    <a target="_blank" title="后天天气" href="javascript:void(0)">
                        <img class="w-100 tqtp" src="/DJSBlog/back/img/projects/3.png" alt="">
						 <p class="m-t-10 tq">
                        	Medical-Pro Bootstrap Responsive	
                        	Medical-Pro Bootstrap Responsive
                        	Medical-Pro Bootstrap Responsive
                        </p>
                    </a>
                    <div class="clearfix"></div>
                </div>
            </div>
            <h3 id="now">dasddddddads</h3>
            <p id="tips">dasddddddads</p>
            
            <div class="clearfix"></div>
        </div>
    </div>
<script type="text/javascript">
$(function(){
	loadTQ();
});
function loadTQ(){
	$.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js', function(_result) { 
	    if (remote_ip_info.ret == '1') { 
	        $.ajax({ 
	            type: "GET", 
	            url: "http://wthrcdn.etouch.cn/weather_mini?city="+remote_ip_info.city, 
	            data: "", 
	            success: function(res){ 
	            	var city =  eval("("+res+")").data.city;
	            	var now =  eval("("+res+")").data.wendu;
	            	var tips = eval("("+res+")").data.ganmao;
	            	var data = eval("("+res+")").data.forecast;
	            	var inner = $('.tq');
	            	var img = $('.tqtp');
	            	for(var i=0;i<inner.length;i++){
	            		var str = "风向:"+data[i].fengxiang+"<br>"
	            			+"风力:"+data[i].fengli+"<br>"
	            			+"最高温:"+data[i].high.substr(2)+"<br>"
	            			+"最低温:"+data[i].low.substr(2)+"<br>"
	            			+"天气:"+data[i].type+"<br>"
	            			+"日期:"+data[i].date.substring(0,3);
	            		inner.eq(i).html(str);
	            		if(data[i].type == '晴') img.eq(i).attr({src:'/DJSBlog/static/tq/qing.png'});
	            		else if(data[i].type == '多云') img.eq(i).attr({src:'/DJSBlog/static/tq/duoyun.png'});
	            		else if(data[i].type == '阵雨') img.eq(i).attr({src:'/DJSBlog/static/tq/zhenyu.png'});
	            		else if(data[i].type == '冰雹') img.eq(i).attr({src:'/DJSBlog/static/tq/bingbao.png'});
	            		else if(data[i].type == '雷阵雨') img.eq(i).attr({src:'/DJSBlog/static/tq/leizhenyu.png'});
	            		else if(data[i].type == '霾') img.eq(i).attr({src:'/DJSBlog/static/tq/mai.png'});
	            		else if(data[i].type == '雾') img.eq(i).attr({src:'/DJSBlog/static/tq/wu.png'});
	            		else if(data[i].type == '小雪') img.eq(i).attr({src:'/DJSBlog/static/tq/xiaoxue.png'});
	            		else if(data[i].type == '中雪') img.eq(i).attr({src:'/DJSBlog/static/tq/zhongxue.png'});
	            		else if(data[i].type == '小雨') img.eq(i).attr({src:'/DJSBlog/static/tq/xiaoyu.png'});
	            		else if(data[i].type == '中雨') img.eq(i).attr({src:'/DJSBlog/static/tq/zhongyu.png'});
	            		else if(data[i].type == '阴') img.eq(i).attr({src:'/DJSBlog/static/tq/ying.png'});
	            		else if(data[i].type == '晴') img.eq(i).attr({src:'/DJSBlog/static/tq/qing.png'});
	            		else if(data[i].type == '雨夹雪') img.eq(i).attr({src:'/DJSBlog/static/tq/yujiaxue.png'});
	            		else if(data[i].type == '阵雪') img.eq(i).attr({src:'/DJSBlog/static/tq/yujiaxue.png'});
	            	}
	            
	            	$('#city').html("天气预报:("+city+")");
	            	$('#tips').html("温馨提示:"+tips+"");
	            	$('#now').html("当前温度:"+now+"℃");
	            } 
	        }); 
	    } 
	});
}
</script>    